import request from '@/utils/request'

// 查询人员信息列表
export function listStaff(query) {
  return request({
    url: '/hospital/staff/list',
    method: 'get',
    params: query
  })
}

// 查询人员信息详细
export function getStaff(staffId) {
  return request({
    url: '/hospital/staff/' + staffId,
    method: 'get'
  })
}

// 新增人员信息
export function addStaff(data) {
  return request({
    url: '/hospital/staff',
    method: 'post',
    data: data
  })
}

// 修改人员信息
export function updateStaff(data) {
  return request({
    url: '/hospital/staff',
    method: 'put',
    data: data
  })
}

// 删除人员信息
export function delStaff(staffId) {
  return request({
    url: '/hospital/staff/' + staffId,
    method: 'delete'
  })
}

//医护人员重置密码
export function resetPwdStaff(userId, password) {
  const data = {
    userId,
    password
  }
  return request({
    url: '/hospital/staff/resetPwd',
    method: 'put',
    data: data
  })
}

// 医护人员启用登录
export function changeStatus(userId, status) {
  const data = {
    userId,
    status
  }
  return request({
    url: '/hospital/staff/changeStatus',
    method: 'put',
    data: data
  })
}

// 医护人员修改签名权限
export function changeSignAuthority(userId,staffId, signAuthority) {
  const data = {
    userId,
    staffId,
    signAuthority
  }
  return request({
    url: '/hospital/staff/changeSignAuthority',
    method: 'put',
    data: data
  })
}

// 根据医院ID查询医院员工列表
export function optionHospStaff(hospitalId) {
  return request({
    url: '/hospital/staff/option',
    method: 'get',
    params: {
      hospitalId
    }
  })
}

// 根据人员id查询负责的医院ids
export function getResponsibleHosp(staffId) {
  return request({
    url: '/hospital/staff/getResponsibleHosp/' + staffId,
    method: 'get'
  })
}

